package com.shantoo.widget.master;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import com.shantoo.widget.imageview.SelectorImageView;
import com.shantoo.widget.toolbar.WidgetBar;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        WidgetBar widgetBar = (WidgetBar) findViewById(R.id.widget_bar);
        widgetBar.setTitle("測試");
        widgetBar.setRightButtonText("aa");
        widgetBar.setRightButtonOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(getApplicationContext(),"aa",Toast.LENGTH_SHORT);
            }
        });
        //widgetBar.showSearchView();
        final SelectorImageView selectorImageView = (SelectorImageView) findViewById(R.id.image);
        selectorImageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                selectorImageView.toggle(!selectorImageView.isChecked());
            }
        });
    }
}
